//集合set
#include <iostream>
#include <set>
using namespace std;

template <typename T>
void show(T container)
{
    for(auto it = container.begin();it != container.end(); it++)
    {
        cout << *it << " "; 
    }
    cout << endl;
}

//自定义比较器
class cmp
{
public:
    bool operator()(int a,int b)
    {
        return a > b;
    }
};

int main(int argc, char const *argv[])
{
    set<int,cmp> s; //默认从小到大，可自定义

    s.insert(1);    //放入元素1
    s.insert(4);
    s.insert(3);
    s.insert(2);

    //s.clear();  //清空容器

    show(s);

    return 0;
}
